<template>
	<view class="page" style="padding: 3% 3%;">
		<Navbar title="关于我们"></Navbar>
		<view class="logo-wrap">
			<image class="logo" src="/static/image/login.png"></image>
			<view class="app-name">长沙星工网科技有限公司</view>
		</view>
		<view v-html="detailData"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 1,
				title: '详情',
				detailData: ''
			};
		},
		onLoad(e) {
			this.id = e.id;
			this.$u.api.AboutUs().then(res => {
				this.detailData = this.imageSrcToBaseUrl(res.data.Body);
			});
		},
		methods: {
			imageSrcToBaseUrl(beforeHtml) {
				let that = this;
				let afterHtml = '';
				if (beforeHtml.indexOf('<img') != -1) {
					afterHtml = beforeHtml.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(img, src) {
						return '<img style="width: 100%;" src="' + that.imgBaseUrl + src + '"/>';
					});
					return afterHtml;
				} else {
					return beforeHtml;
				}
			}
		}
	};
</script>
<style lang="scss" scoped>
	.logo-wrap {
		display: flex;
		justify-content: center;
		padding-top: 40rpx;
		padding-bottom: 48rpx;
		flex-wrap: wrap;

		.logo {
			height: 220rpx;
			width: 220rpx;
		}

		.app-name {
			width: 100%;
			padding-top: 20rpx;
			text-align: center;
			font-size: 44rpx;
			font-weight: 500;
			color: $app-theme-text-black-color;
		}
	}
</style>